#ifndef _FIG_FIGHTER_H_
#define _FIG_FIGHTER_H_

#include "ui/ui_manager.h"

namespace gameflow
{
	class UIPopup;
}

class FIGPlayerCraft;
class FIGBulletManager;
class FIGLevel;
class FIGEnemyManager;
class FIGSFXManager;
class FIGCraft;


class Fighter
{
public:

	static Fighter&			Instance();

	

	void					Render();
	void					PostRender();			// some sfx render after UI
	void					RenderShadow();
	void					RenderDebug();
	void					Tick(float dt);
	void					Clear();
	
	void					LoadFromFile(const std::string& File);
	void					SaveToFile();

	void					OnMouseMove(const math::Vec2& From, const math::Vec2& To);
	void					MouseButtonPressed(input::Mouse::BUTTON_STATE* pKey, const math::Vec2& Pos);
	void					MouseButtonReleased(input::Mouse::BUTTON_STATE* pKey, const math::Vec2& Pos);
	void					MouseButtonDown(input::Mouse::BUTTON_STATE* pKey, const math::Vec2& Pos);


	void					KeyDown(input::Keyboard::KEY* pKey);
	void					KeyPressed(input::Keyboard::KEY* pKey);
		
	const math::Vec2&		GetOffset() { return m_Offset; };
	const math::Vec2&		GetMousePos()const { return m_MousePos; };
	float					GetScale() const { return m_Scale; };

	void					ShakeScreen(float Intensity);
	


	FIGLevel*				GetLevel() { return m_pLevel; };
	void					GoToNextLevel();
	void					PlayLevel(int LevelNumber);
	

	void					ResetDebugValues(float LevelMovementDelaySec);
	
protected:

	Fighter();
	~Fighter();



	FIGLevel*				m_pLevel;
		
	FIGSFXManager*			m_pExplodingManager;	
	float					m_Scale;
	
	bool					m_IsDebuuging;
	static float			m_Acceleration;
	math::Vec2				m_Offset;
	math::Vec2				m_MousePos;
		

   	int						m_FPS;
	int						m_FPSTemp;
	math::Counter			m_FPSCounter;
	float					m_TestTime;
	float					m_DebugOffsetY;

	int						m_ControllerKeyDirX;
	int						m_ControllerKeyDirY;
	

};


#endif //_FIG_FIGHTER_H_